<?php /*a:1:{s:66:"E:\www\yirenzhuangxiu\application\user\view\setup\articlelist.html";i:1564361279;}*/ ?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="renderer" content="webkit"/>
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<link rel="icon" type="image/png" href="assets/user/i/favicon.ico"/>
<meta name="apple-mobile-web-app-title"/>
<link rel="stylesheet" href="assets/layer/theme/default/layer.css"/>
<link rel="stylesheet" href="assets/user/css/wy_modality.css"/>
<script src="assets/user/js/jquery.min.js"></script>
<link rel="stylesheet" href="/assets/user/vendors/iconfonts/mdi/css/materialdesignicons.min.css"/>
<link rel="stylesheet" href="/assets/user/vendors/css/vendor.bundle.base.css"/>
<script>        BASE_URL = '<?php echo htmlentities($base_url); ?>';        STORE_URL = '/index.php?s=/user';    </script>
</head>
<body data-type="">
<div class="row-content layer-cf">
	<div class="row">
		<div class="layer-u-sm-12 layer-u-md-12 layer-u-lg-12">
			<div class="widget layer-cf ">
				<div class="widget-head layer-cf">
					<div class="widget-title layer-cf">
												出售中的商品
					</div>
				</div>
				<div class="widget-body layer-fr">
					<!-- 工具栏 -->
					<div class="page_toolbar layer-margin-bottom-xs layer-cf">
						<form class="toolbar-form" action="">
							<input type="hidden" name="s" value="/<?php echo htmlentities($request->pathinfo()); ?>">
							<div class="layer-u-sm-12 layer-u-md-9">
								<div class="layer">
									<div class="layer-form-group layer-fl">
										<span style="display:none;"><?php echo $category_id = $request->get('category_id')?: null; ?></span>
										<select class="form-control" name="category_id" data-layer-selected="{searchBox: 1, btnSize: 'sm', placeholder: '商品分类', maxHeight: 400}">
											<option value="">商品分类</option>
											                                          <?php if(isset($catgory)): ?>:											<?php foreach($catgory as $first): ?>
											<option value="<?php echo htmlentities($first['id']); ?>">                                                    <?php echo htmlentities($first['name']); ?>											</option>
											                                            <?php endforeach; ?><?php endif; ?>
										</select>
									</div>
									<div class="layer-form-group layer-fl">
										<span style="display:none;"> <?php echo $status = $request->get('	status')?: null; ?></span>
										<select class="form-control" name="status" data-layer-selected="{btnSize: 'sm', placeholder: '商品状态'}">
											<option value="">商品状态</option>
											<option value="10" <?php echo $status==1 ? 'selected'  :  ''; ?>>上架											</option>
											<option value="20" <?php echo $status==0 ? 'selected'  :  ''; ?>>下架											</option>
										</select>
									</div>
									<div class="layer-form-group layer-fl">
										<div class="layer-input-group layer-input-group-sm tpl-form-border-form">
											<input type="text" class="layer-form-field" name="name" placeholder="请输入商品名称" value="<?php echo htmlentities($request->get('name')); ?>">
											<div class="layer-input-group-btn">
												<button class="layer-btn layer-btn-default mdi menu-icon mdi-magnify" type="submit"></button>
											</div>
										</div>
									</div>
								</div>
							</div>
						</form>
					</div>
					<div class="layer-scrollable-horizontal layer-u-sm-12">
						<table width="100%" class="layer-table layer-table-compact layer-table-striped tpl-table-black layer-text-nowrap">
						<thead>
						<tr>
							<th>
																选择
							</th>
							<th>
																商品ID
							</th>
							<th>
																商品图片
							</th>
							<th>
																名称
							</th>
							<th>
																排序
							</th>
							<th>
																状态
							</th>
							<th>
																添加时间
							</th>
						</tr>
						</thead>
						<tbody id="goos_table">
						                            <?php if(!$list->isEmpty()): foreach($list['date'] as $item): ?>
						<tr>
							<td class="layer-text-middle">
								<input type="radio" name="goodsid" data-id="<?php echo htmlentities($item['goods_id']); ?>"  <?php if(!(empty($list[0]['image'][0]) || (($list[0]['image'][0] instanceof \think\Collection || $list[0]['image'][0] instanceof \think\Paginator ) && $list[0]['image'][0]->isEmpty()))): ?> data-image="<?php echo htmlentities($list[0]['image'][0]['file_path']); ?>"<?php endif; ?>
							data-name="<?php echo htmlentities($item['goods_name']); ?>"  onclick="changeGoods(this)" value="<?php echo htmlentities($item['goods_id']); ?>"/>
							</td>
							<td class="layer-text-middle">
																<?php echo htmlentities($item['goods_id']); ?>
							</td>
							<td class="layer-text-middle">
							<?php if(!(empty($list[0]['image'][0]) || (($list[0]['image'][0] instanceof \think\Collection || $list[0]['image'][0] instanceof \think\Paginator ) && $list[0]['image'][0]->isEmpty()))): ?>
							<img class="images" style="width:50px;"src='<?php echo htmlentities($list[0]["image"][0]["file_path"]); ?>'	/>
							<?php else: ?>
							<p class="item-title">暂无</p>
							<?php endif; ?>
							</td>
							<td class="layer-text-middle">
								<p class="item-title">
																		<?php echo htmlentities($item['goods_name']); ?>
								</p>
							</td>
							<td class="layer-text-middle">
																<?php echo htmlentities($item['sort']); ?>
							</td>
							<td class="layer-text-middle">
								<span class="j-state layer-badge x-cur-p layer-badge-<?php echo $item['is_on_sale']==1 ? 'success'  :  'warning'; ?>" data-id="<?php echo htmlentities($item['goods_id']); ?>" data-state="<?php echo htmlentities($item['is_on_sale']); ?>">
								<?php if($item['is_on_sale'] == 1): ?>上架<?php else: ?>下架<?php endif; ?>
								</span>
							</td>
							<td class="layer-text-middle">
																<?php echo htmlentities($item['create_time']); ?>
							</td>
						</tr>
														<?php endforeach; else: ?>
						<tr>
							<td colspan="9" class="layer-text-center">
																暂无记录
							</td>
						</tr>
						                            <?php endif; ?>
						</tbody>
						</table>
					</div>
					<div class="layer-u-lg-12 layer-cf">
						<div class="layer-fr">
														<?php echo $list; ?>
						</div>
						<div class="layer-fr pagination-total layer-margin-right">
							<div class="layer-vertical-align-middle">
																总记录：<?php echo htmlentities($list->total()); ?>
							</div>
						</div>
					</div>
					<div class="layer-form-group">
						<div class="layer-u-sm-9 layer-u-sm-push-3 layer-margin-top-lg">
							<button type="submit" onclick="select_goods();" class="j-submits layer-btn layer-btn-secondary">确定							</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>
<script>
var goods_id = 0 , goods_name = '' , store_count = '';
function changeGoods(obj){
 goods_id = $(obj).attr('data-id');
 goods_name = $(obj).attr('data-name');
  goods_image = $(obj).attr('data-image');
 }
 function select_goods()  {
 if($("input[type='radio']:checked").length == 0){
 layer.alert('请选择商品', {icon: 2});
 return false;
 }
 window.parent.call_back(goods_id,goods_name,goods_image);
 }      </script>